/* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
/*
 * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
 */
#ifndef __MSM_VIDC_H__
#define __MSM_VIDC_H__

#include <linux/types.h>

#define MSM_VIDC_HAL_INTERLACE_COLOR_FORMAT_NV12	0x2
#define MSM_VIDC_HAL_INTERLACE_COLOR_FORMAT_NV12_UBWC	0x8002
#define MSM_VIDC_4x_1 0x1
#define MSM_VIDC_EXTRADATA_FRAME_QP_ADV 0x1


static inline unsigned int VENUS_EXTRADATA_SIZE(int width, int height)
{
	(void)height;
	(void)width;
	/*
	 * In the future, calculate the size based on the w/h but just
	 * hardcode it for now since 16K satisfies all current usecases.
	 */
	return 16 * 1024;
}

enum v4l2_mpeg_vidc_video_pictype_dec_enable {
	V4L2_MPEG_VIDC_VIDEO_PICTYPE_DECODE_OFF = 0,
	V4L2_MPEG_VIDC_VIDEO_PICTYPE_DECODE_ON = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_KEEP_ASPECT_RATIO \
	(V4L2_CID_MPEG_MSM_VIDC_BASE+1)

#define V4L2_MPEG_VIDC_VIDEO_NAL_FORMAT_ONE_NAL_PER_BUFFER	1
#define V4L2_MPEG_VIDC_VIDEO_NAL_FORMAT_ONE_BYTE_LENGTH	2
#define V4L2_MPEG_VIDC_VIDEO_NAL_FORMAT_TWO_BYTE_LENGTH	3

#define V4L2_CID_MPEG_VIDC_VIDEO_IDR_PERIOD   (V4L2_CID_MPEG_MSM_VIDC_BASE+5)
#define V4L2_CID_MPEG_VIDC_VIDEO_NUM_P_FRAMES (V4L2_CID_MPEG_MSM_VIDC_BASE+6)
#define V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES (V4L2_CID_MPEG_MSM_VIDC_BASE+7)
#define V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_IFRAME (V4L2_CID_MPEG_MSM_VIDC_BASE+8)

#define V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL (V4L2_CID_MPEG_MSM_VIDC_BASE+9)
enum v4l2_mpeg_vidc_video_rate_control {
	V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_OFF = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_VFR = 1,
	V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_VBR_CFR = 2,
	V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_VFR = 3,
	V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CBR_CFR = 4,
	V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_MBR_CFR = 5,
	V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_MBR_VFR = 6,
	V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_CQ = 7,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_MBR_CFR   \
		V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_MBR_CFR
#define V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_MBR_VFR   \
		V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_MBR_VFR

#define V4L2_CID_MPEG_VIDC_VIDEO_ROTATION (V4L2_CID_MPEG_MSM_VIDC_BASE+10)
enum v4l2_mpeg_vidc_video_rotation {
	V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_NONE = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 = 1,
	V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_180 = 2,
	V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270 = 3,
};
#define V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL \
		(V4L2_CID_MPEG_MSM_VIDC_BASE+11)
enum v4l2_mpeg_vidc_h264_cabac_model {
	V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_0 = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_1 = 1,
	V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_2 = 2,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_MODE_CYCLIC \
		(V4L2_CID_MPEG_MSM_VIDC_BASE+12)

#define V4L2_CID_MPEG_VIDC_VIDEO_STREAM_OUTPUT_MODE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 22)
enum v4l2_mpeg_vidc_video_decoder_multi_stream {
	V4L2_CID_MPEG_VIDC_VIDEO_STREAM_OUTPUT_PRIMARY = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_STREAM_OUTPUT_SECONDARY = 1,
};

enum v4l2_mpeg_vidc_video_sync_frame_decode {
	V4L2_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE_DISABLE = 0,
	V4L2_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE_ENABLE = 1
};

enum v4l2_mpeg_vidc_video_au_delimiter {
	V4L2_MPEG_VIDC_VIDEO_AU_DELIMITER_DISABLED = 0,
	V4L2_MPEG_VIDC_VIDEO_AU_DELIMITER_ENABLED = 1
};

enum v4l2_mpeg_vidc3x_extradata {
		V4L2_MPEG_VIDC_EXTRADATA_NONE = 0,
	V4L2_MPEG_VIDC_EXTRADATA_MB_QUANTIZATION = 1,
	V4L2_MPEG_VIDC_EXTRADATA_INTERLACE_VIDEO = 2,
 #define V4L2_MPEG_VIDC_EXTRADATA_ENC_DTS \
	V4L2_MPEG_VIDC_EXTRADATA_ENC_DTS
	V4L2_MPEG_VIDC_EXTRADATA_ENC_DTS = 3,
	V4L2_MPEG_VIDC_EXTRADATA_VC1_FRAMEDISP = 4,
	V4L2_MPEG_VIDC_EXTRADATA_TIMESTAMP = 5,
	V4L2_MPEG_VIDC_EXTRADATA_S3D_FRAME_PACKING = 6,
	V4L2_MPEG_VIDC_EXTRADATA_FRAME_RATE = 7,
	V4L2_MPEG_VIDC_EXTRADATA_PANSCAN_WINDOW = 8,
	V4L2_MPEG_VIDC_EXTRADATA_RECOVERY_POINT_SEI = 9,
	V4L2_MPEG_VIDC_EXTRADATA_MULTISLICE_INFO = 10,
	V4L2_MPEG_VIDC_EXTRADATA_NUM_CONCEALED_MB = 11,
	V4L2_MPEG_VIDC_EXTRADATA_METADATA_FILLER = 12,
#define V4L2_MPEG_VIDC_EXTRADATA_INPUT_CROP \
	V4L2_MPEG_VIDC_EXTRADATA_INPUT_CROP
	V4L2_MPEG_VIDC_EXTRADATA_INPUT_CROP = 13,
	V4L2_MPEG_VIDC_EXTRADATA_DIGITAL_ZOOM = 14,
	V4L2_MPEG_VIDC_EXTRADATA_ASPECT_RATIO = 15,
	V4L2_MPEG_VIDC_EXTRADATA_MPEG2_SEQDISP = 16,
	V4L2_MPEG_VIDC_EXTRADATA_STREAM_USERDATA = 17,
	V4L2_MPEG_VIDC_EXTRADATA_FRAME_QP = 18,
	V4L2_MPEG_VIDC_EXTRADATA_FRAME_BITS_INFO = 19,
	V4L2_MPEG_VIDC_EXTRADATA_LTR = 20,
	V4L2_MPEG_VIDC_EXTRADATA_METADATA_MBI = 21,
	V4L2_MPEG_VIDC_EXTRADATA_VQZIP_SEI = 22,
#define V4L2_MPEG_VIDC_EXTRADATA_HDR10PLUS_METADATA \
	V4L2_MPEG_VIDC_EXTRADATA_HDR10PLUS_METADATA
	V4L2_MPEG_VIDC_EXTRADATA_HDR10PLUS_METADATA = 23,
	V4L2_MPEG_VIDC_EXTRADATA_ROI_QP = 24,
#define V4L2_MPEG_VIDC_EXTRADATA_OUTPUT_CROP \
	V4L2_MPEG_VIDC_EXTRADATA_OUTPUT_CROP
	V4L2_MPEG_VIDC_EXTRADATA_OUTPUT_CROP = 25,
#define V4L2_MPEG_VIDC_EXTRADATA_DISPLAY_COLOUR_SEI \
	V4L2_MPEG_VIDC_EXTRADATA_DISPLAY_COLOUR_SEI
	V4L2_MPEG_VIDC_EXTRADATA_DISPLAY_COLOUR_SEI = 26,
#define V4L2_MPEG_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI \
	V4L2_MPEG_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI
	V4L2_MPEG_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI = 27,
#define V4L2_MPEG_VIDC_EXTRADATA_PQ_INFO \
	V4L2_MPEG_VIDC_EXTRADATA_PQ_INFO
	V4L2_MPEG_VIDC_EXTRADATA_PQ_INFO = 28,
#define V4L2_MPEG_VIDC_EXTRADATA_VUI_DISPLAY \
	V4L2_MPEG_VIDC_EXTRADATA_VUI_DISPLAY
	V4L2_MPEG_VIDC_EXTRADATA_VUI_DISPLAY = 29,
#define V4L2_MPEG_VIDC_EXTRADATA_VPX_COLORSPACE \
	V4L2_MPEG_VIDC_EXTRADATA_VPX_COLORSPACE
	V4L2_MPEG_VIDC_EXTRADATA_VPX_COLORSPACE = 30,
#define V4L2_MPEG_VIDC_EXTRADATA_UBWC_CR_STATS_INFO \
	V4L2_MPEG_VIDC_EXTRADATA_UBWC_CR_STATS_INFO
	V4L2_MPEG_VIDC_EXTRADATA_UBWC_CR_STATS_INFO = 31,
#define V4L2_MPEG_VIDC_EXTRADATA_ENC_FRAME_QP \
	V4L2_MPEG_VIDC_EXTRADATA_ENC_FRAME_QP
	V4L2_MPEG_VIDC_EXTRADATA_ENC_FRAME_QP = 32,
	V4L2_MPEG_VIDC_EXTRADATA_VC1_SEQDISP = 33,
	V4L2_MPEG_VIDC_EXTRADATA_YUV_STATS = 34,
};

#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_DELIVERY_MODE   \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 18)

enum v4l2_mpeg_vidc_video_vui_timing_info {
	V4L2_MPEG_VIDC_VIDEO_VUI_TIMING_INFO_DISABLED = 0,
	V4L2_MPEG_VIDC_VIDEO_VUI_TIMING_INFO_ENABLED = 1
};

#define V4L2_CID_MPEG_VIDC_VIDEO_PRESERVE_TEXT_QUALITY \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 21)
enum v4l2_mpeg_vidc_video_preserve_text_quality {
	V4L2_MPEG_VIDC_VIDEO_PRESERVE_TEXT_QUALITY_DISABLED = 0,
	V4L2_MPEG_VIDC_VIDEO_PRESERVE_TEXT_QUALITY_ENABLED = 1
};

#define V4L2_MPEG_VIDC_VIDEO_MPEG2_PROFILE_SNR_SCALABLE	3
#define V4L2_MPEG_VIDC_VIDEO_MPEG2_PROFILE_SPATIAL_SCALABLE	4
#define V4L2_MPEG_VIDC_VIDEO_MPEG2_PROFILE_422 5

enum v4l2_mpeg_vidc_video_mvc_layout {
	V4L2_MPEG_VIDC_VIDEO_MVC_SEQUENTIAL = 0,
	V4L2_MPEG_VIDC_VIDEO_MVC_TOP_BOTTOM = 1
};

#define V4L2_CID_MPEG_VIDC_VIDEO_CONCEAL_COLOR \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 25)

#define V4L2_CID_MPEG_VIDC_VIDEO_LTRMODE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 26)

enum v4l2_mpeg_vidc_video_ltrmode {
	V4L2_MPEG_VIDC_VIDEO_LTR_MODE_DISABLE = 0,
	V4L2_MPEG_VIDC_VIDEO_LTR_MODE_MANUAL = 1,
	V4L2_MPEG_VIDC_VIDEO_LTR_MODE_PERIODIC = 2
};

#define V4L2_CID_MPEG_VIDC_VIDEO_HIER_P_NUM_LAYERS \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 30)

#define V4L2_CID_MPEG_VIDC_VIDEO_ALLOC_MODE_OUTPUT       \
		(V4L2_CID_MPEG_MSM_VIDC_BASE+31)
enum v4l2_mpeg_vidc_video_alloc_mode_type {
	V4L2_MPEG_VIDC_VIDEO_STATIC = 0,
	V4L2_MPEG_VIDC_VIDEO_RING = 1,
	V4L2_MPEG_VIDC_VIDEO_DYNAMIC = 2,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_X_RANGE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 32)

#define V4L2_CID_MPEG_VIDC_VIDEO_PFRAME_X_RANGE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 33)

#define V4L2_CID_MPEG_VIDC_VIDEO_BFRAME_X_RANGE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 34)

#define V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_Y_RANGE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 35)

#define V4L2_CID_MPEG_VIDC_VIDEO_PFRAME_Y_RANGE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 36)

#define V4L2_CID_MPEG_VIDC_VIDEO_BFRAME_Y_RANGE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 37)

enum vl42_mpeg_vidc_video_vpx_error_resilience {
	V4L2_MPEG_VIDC_VIDEO_VPX_ERROR_RESILIENCE_DISABLED = 0,
	V4L2_MPEG_VIDC_VIDEO_VPX_ERROR_RESILIENCE_ENABLED = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_HEVC_PROFILE \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 40)
enum v4l2_cid_mpeg_video_hevc_profile {
	V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN			= 0,
	V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN10		= 1,
	V4L2_MPEG_VIDC_VIDEO_HEVC_PROFILE_MAIN_STILL_PIC	= 2,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_HEVC_TIER_LEVEL \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 41)
enum v4l2_cid_mpeg_video_hevc_level {
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_1	= 0,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_1	= 1,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_2	= 2,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_2	= 3,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_2_1	= 4,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_2_1	= 5,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_3	= 6,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_3	= 7,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_3_1	= 8,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_3_1	= 9,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_4	= 10,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_4	= 11,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_4_1	= 12,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_4_1	= 13,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5	= 14,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5	= 15,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5_1	= 16,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5_1	= 17,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_5_2	= 18,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_5_2	= 19,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6	= 20,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_6	= 21,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6_1	= 22,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_6_1	= 23,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_MAIN_TIER_LEVEL_6_2	= 24,
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_HIGH_TIER_LEVEL_6_2	= 25,
#define V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_UNKNOWN \
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_UNKNOWN
	V4L2_MPEG_VIDC_VIDEO_HEVC_LEVEL_UNKNOWN = 26,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_HIER_B_NUM_LAYERS \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 42)

#define V4L2_CID_MPEG_VIDC_VIDEO_HYBRID_HIERP_MODE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 43)

#define V4L2_CID_MPEG_VIDC_VIDEO_DPB_COLOR_FORMAT \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 44)

enum v4l2_mpeg_vidc_video_dpb_color_format {
	V4L2_MPEG_VIDC_VIDEO_DPB_COLOR_FMT_NONE = 0,
	V4L2_MPEG_VIDC_VIDEO_DPB_COLOR_FMT_UBWC = 1,
	V4L2_MPEG_VIDC_VIDEO_DPB_COLOR_FMT_TP10_UBWC = 2
};

#define V4L2_CID_VIDC_QBUF_MODE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 45)
enum v4l2_vidc_qbuf_mode {
	V4L2_VIDC_QBUF_STANDARD = 0,
	V4L2_VIDC_QBUF_BATCHED = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_MAX_HIERP_LAYERS \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 46)

#define V4L2_CID_MPEG_VIDC_VENC_PARAM_SAR_WIDTH \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 48)

#define V4L2_CID_MPEG_VIDC_VENC_PARAM_SAR_HEIGHT \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 49)

#define V4L2_CID_MPEG_VIDC_VIDEO_VQZIP_SEI	\
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 50)

enum v4l2_mpeg_vidc_video_vqzip_sei_enable {
	V4L2_CID_MPEG_VIDC_VIDEO_VQZIP_SEI_DISABLE	= 0,
	V4L2_CID_MPEG_VIDC_VIDEO_VQZIP_SEI_ENABLE	= 1
};

#define V4L2_CID_MPEG_VIDC_VENC_PARAM_LAYER_BITRATE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 51)

enum v4l2_mpeg_vidc_video_priority {
	V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_ENABLE = 0,
	V4L2_MPEG_VIDC_VIDEO_PRIORITY_REALTIME_DISABLE = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_VENC_BITRATE_TYPE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 54)

enum v4l2_mpeg_vidc_video_venc_bitrate_type_enable {
	V4L2_CID_MPEG_VIDC_VIDEO_VENC_BITRATE_DISABLE	= 0,
	V4L2_CID_MPEG_VIDC_VIDEO_VENC_BITRATE_ENABLE	= 1
};

enum v4l2_cid_mpeg_vidc_video_vpe_csc_type_enable {
	V4L2_CID_MPEG_VIDC_VIDEO_VPE_CSC_DISABLE  = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_VPE_CSC_ENABLE   = 1
};

enum v4l2_mpeg_vidc_video_lowlatency_mode {
	V4L2_CID_MPEG_VIDC_VIDEO_LOWLATENCY_DISABLE     = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_LOWLATENCY_ENABLE      = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_BLUR_WIDTH \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 58)

#define V4L2_CID_MPEG_VIDC_VIDEO_BLUR_HEIGHT \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 59)

enum v4l2_cid_mpeg_vidc_video_full_range {
	V4L2_CID_MPEG_VIDC_VIDEO_FULL_RANGE_DISABLE = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_FULL_RANGE_ENABLE = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_TYPE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 64)

#define V4L2_CID_MPEG_VIDC_VIDEO_LAYER_ID \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 65)

#define V4L2_CID_MPEG_VIDC_VIDEO_VP9_PROFILE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 66)
enum v4l2_mpeg_vidc_video_vp9_profile {
	V4L2_MPEG_VIDC_VIDEO_VP9_PROFILE_UNUSED = 0,
	V4L2_MPEG_VIDC_VIDEO_VP9_PROFILE_P0 = 1,
	V4L2_MPEG_VIDC_VIDEO_VP9_PROFILE_P2_10 = 2,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_COLOR_SPACE_CAPS \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 68)
#define V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_CAPS \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 69)

#define V4L2_CID_MPEG_VIDC_VIDEO_MB_ERROR_MAP_REPORTING \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 70)
#define V4L2_CID_MPEG_VIDC_VIDEO_CONTINUE_DATA_TRANSFER \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 71)

#define V4L2_CID_MPEG_VIDC_VIDEO_ALLOC_MODE_INPUT \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 72)

#define V4L2_CID_MPEG_VIDC_VIDEO_FRAME_ASSEMBLY	\
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 73)
enum v4l2_mpeg_vidc_video_assembly {
	V4L2_MPEG_VIDC_FRAME_ASSEMBLY_DISABLE = 0,
	V4L2_MPEG_VIDC_FRAME_ASSEMBLY_ENABLE = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_H263_PROFILE\
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 74)
enum v4l2_mpeg_vidc_video_h263_profile {
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_BASELINE = 0,
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_H320CODING	= 1,
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_BACKWARDCOMPATIBLE = 2,
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_ISWV2 = 3,
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_ISWV3 = 4,
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_HIGHCOMPRESSION = 5,
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_INTERNET = 6,
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_INTERLACE = 7,
	V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_HIGHLATENCY = 8,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_OUTPUT_ORDER \
		(V4L2_CID_MPEG_MSM_VIDC_BASE+75)
enum v4l2_mpeg_vidc_video_output_order {
	V4L2_MPEG_VIDC_VIDEO_OUTPUT_ORDER_DISPLAY         = 0,
	V4L2_MPEG_VIDC_VIDEO_OUTPUT_ORDER_DECODE          = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_H264_TRANSFORM_8x8 \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 76)
enum v4l2_mpeg_vidc_video_h264_transform_8x8 {
	V4L2_MPEG_VIDC_VIDEO_H264_TRANSFORM_8x8_DISABLE = 0,
	V4L2_MPEG_VIDC_VIDEO_H264_TRANSFORM_8x8_ENABLE = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_QP_MASK \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 77)

#define V4L2_CID_MPEG_VIDEO_MIN_QP_PACKED \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 96)
#define V4L2_CID_MPEG_VIDEO_MAX_QP_PACKED \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 97)
#define V4L2_CID_MPEG_VIDC_VIDEO_ADAPTIVE_B \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 98)
#define V4L2_CID_MPEG_VIDC_VIDEO_I_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 99)
#define V4L2_CID_MPEG_VIDC_VIDEO_P_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 100)
#define V4L2_CID_MPEG_VIDC_VIDEO_B_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 101)
#define V4L2_CID_MPEG_VIDC_VIDEO_I_FRAME_QP_MIN \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 102)
#define V4L2_CID_MPEG_VIDC_VIDEO_P_FRAME_QP_MIN \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 103)
#define V4L2_CID_MPEG_VIDC_VIDEO_B_FRAME_QP_MIN \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 104)
#define V4L2_CID_MPEG_VIDC_VIDEO_I_FRAME_QP_MAX \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 105)
#define V4L2_CID_MPEG_VIDC_VIDEO_P_FRAME_QP_MAX \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 106)
#define V4L2_CID_MPEG_VIDC_VIDEO_B_FRAME_QP_MAX \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 107)

enum v4l2_mpeg_vidc_video_venc_iframesize_type {
	V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_DEFAULT,
	V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_MEDIUM,
	V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_HUGE,
	V4L2_CID_MPEG_VIDC_VIDEO_IFRAME_SIZE_UNLIMITED,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_TME_PROFILE  \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 111)

enum v4l2_mpeg_vidc_video_tme_profile {
	V4L2_MPEG_VIDC_VIDEO_TME_PROFILE_0 = 0,
	V4L2_MPEG_VIDC_VIDEO_TME_PROFILE_1 = 1,
	V4L2_MPEG_VIDC_VIDEO_TME_PROFILE_2 = 2,
	V4L2_MPEG_VIDC_VIDEO_TME_PROFILE_3 = 3,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_TME_LEVEL \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 112)

enum v4l2_mpeg_vidc_video_tme_level {
	V4L2_MPEG_VIDC_VIDEO_TME_LEVEL_INTEGER = 0,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_TME_PAYLOAD_VERSION  \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 113)

#define V4L2_CID_MPEG_VIDC_VIDEO_FLIP (V4L2_CID_MPEG_MSM_VIDC_BASE + 115)
enum v4l2_mpeg_vidc_video_flip {
	V4L2_CID_MPEG_VIDC_VIDEO_FLIP_NONE = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_FLIP_HORI = 1,
	V4L2_CID_MPEG_VIDC_VIDEO_FLIP_VERT = 2,
	V4L2_CID_MPEG_VIDC_VIDEO_FLIP_BOTH = 3,
};

/* HDR SEI INFO related control IDs and definitions*/
#define V4L2_MPEG_VIDC_VENC_HDR_INFO_ENABLED 1
#define V4L2_MPEG_VIDC_VENC_HDR_INFO_DISABLED 0

#define V4L2_CID_MPEG_VIDC_SET_PERF_LEVEL \
	(V4L2_CID_MPEG_MSM_VIDC_BASE + 128)
enum v4l2_mpeg_vidc_perf_level {
	V4L2_CID_MPEG_VIDC_PERF_LEVEL_NOMINAL   = 0,
	V4L2_CID_MPEG_VIDC_PERF_LEVEL_PERFORMANCE       = 1,
	V4L2_CID_MPEG_VIDC_PERF_LEVEL_TURBO     = 2,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_AIR_MBS (V4L2_CID_MPEG_MSM_VIDC_BASE + 134)
#define V4L2_CID_MPEG_VIDC_VIDEO_AIR_REF (V4L2_CID_MPEG_MSM_VIDC_BASE + 135)
#define V4L2_CID_MPEG_VIDC_VIDEO_CIR_MBS (V4L2_CID_MPEG_MSM_VIDC_BASE + 136)

#define V4L2_CID_MPEG_VIDC_VIDEO_H264_VUI_TIMING_INFO \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 137)

#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_GOB \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 138)

#define V4L2_CID_MPEG_VIDC_VIDEO_H264_VUI_BITSTREAM_RESTRICT \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 139)
enum v4l2_mpeg_vidc_video_h264_vui_bitstream_restrict {
	V4L2_MPEG_VIDC_VIDEO_H264_VUI_BITSTREAM_RESTRICT_DISABLED = 0,
	V4L2_MPEG_VIDC_VIDEO_H264_VUI_BITSTREAM_RESTRICT_ENABLED = 1
};

#define V4L2_CID_MPEG_VIDC_VIDEO_DEINTERLACE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 140)
enum v4l2_mpeg_vidc_video_deinterlace {
	V4L2_CID_MPEG_VIDC_VIDEO_DEINTERLACE_DISABLED = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_DEINTERLACE_ENABLED
};

#define V4L2_CID_MPEG_VIDC_VIDEO_MPEG4_TIME_RESOLUTION \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 141)

#define V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_SEQ_HEADER \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 142)

#define V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL_TIMESTAMP_MODE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 143)
enum v4l2_mpeg_vidc_video_rate_control_timestamp_mode {
	V4L2_MPEG_VIDC_VIDEO_RATE_CONTROL_TIMESTAMP_MODE_HONOR = 0,
	V4L2_MPEG_VIDC_VIDEO_RATE_CONTROL_TIMESTAMP_MODE_IGNORE = 1,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_ENABLE_INITIAL_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 144)
enum vl42_mpeg_vidc_video_enable_initial_qp {
	V4L2_CID_MPEG_VIDC_VIDEO_ENABLE_INITIAL_QP_IFRAME = 0x1,
	V4L2_CID_MPEG_VIDC_VIDEO_ENABLE_INITIAL_QP_PFRAME = 0x2,
	V4L2_CID_MPEG_VIDC_VIDEO_ENABLE_INITIAL_QP_BFRAME = 0x4,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_I_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 145)

#define V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_P_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 146)

#define V4L2_CID_MPEG_VIDC_VIDEO_INITIAL_B_FRAME_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 147)

#define V4L2_CID_MPEG_VIDC_VIDEO_H264_NAL_SVC \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 148)

#define V4L2_CID_MPEG_VIDC_VIDEO_PERF_MODE	 \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 149)
enum v4l2_mpeg_vidc_video_perf_mode {
	V4L2_MPEG_VIDC_VIDEO_PERF_MAX_QUALITY = 1,
	V4L2_MPEG_VIDC_VIDEO_PERF_POWER_SAVE = 2
};

#define V4L2_CID_MPEG_VIDC_VIDEO_MBI_STATISTICS_MODE	\
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 150)

#define V4L2_CID_MPEG_VIDC_VIDEO_CONFIG_QP \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 151)

#define V4L2_CID_MPEG_VIDC_VIDEO_H264_PIC_ORDER_CNT \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 152)

#define V4L2_CID_MPEG_VIDC_VIDEO_SCS_THRESHOLD \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 153)

#define V4L2_CID_MPEG_VIDC_VIDEO_MVC_BUFFER_LAYOUT \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 154)


#define V4L2_CID_MPEG_VIDC_VIDEO_SECURE_SCALING_THRESHOLD \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 155)

#define V4L2_CID_MPEG_VIDC_VIDEO_NON_SECURE_OUTPUT2 \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 156)

#define V4L2_CID_MPEG_VIDC_VIDEO_VP8_MIN_QP (V4L2_CID_MPEG_MSM_VIDC_BASE + 157)
#define V4L2_CID_MPEG_VIDC_VIDEO_VP8_MAX_QP (V4L2_CID_MPEG_MSM_VIDC_BASE + 158)

#define V4L2_CID_MPEG_VIDC_VIDEO_H263_LEVEL (V4L2_CID_MPEG_MSM_VIDC_BASE + 159)
enum v4l2_mpeg_vidc_video_h263_level {
	V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_1_0 = 0,
	V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_2_0 = 1,
	V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_3_0 = 2,
	V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_4_0 = 3,
	V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_4_5 = 4,
	V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_5_0 = 5,
	V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_6_0 = 6,
	V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_7_0 = 7,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_POST_LOOP_DEBLOCKER_MODE \
		(V4L2_CID_MPEG_MSM_VIDC_BASE + 160)


#define V4L2_CID_MPEG_VIDC_VIDEO_DIVX_FORMAT (V4L2_CID_MPEG_MSM_VIDC_BASE+161)

enum v4l2_mpeg_vidc_video_divx_format_type {
		V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_4 = 0,
		V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_5 = 1,
		V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_6 = 2,
};

#define V4L2_CID_MPEG_VIDC_IMG_GRID_DIMENSION \
	(V4L2_CID_MPEG_MSM_VIDC_BASE+163)

#define V4L2_CID_MPEG_VIDC_VIDEO_FRAME_QP \
	(V4L2_CID_MPEG_MSM_VIDC_BASE+164)

#define  \
V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_MODE \
	(V4L2_CID_MPEG_MSM_VIDC_BASE+165)
enum v4l2_mpeg_vidc_video_intra_refresh_mode {
	V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_NONE = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_CYCLIC = 1,
	V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_RANDOMMODE = 2,
	V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_ADAPTIVE = 3,
	V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_CYCLIC_ADAPTIVE = 4,
};

#define V4L2_CID_MPEG_VIDC_VIDEO_IR_MBS (V4L2_CID_MPEG_MSM_VIDC_BASE+166)

enum v4l2_mpeg_vidc_video_mbi_statistics_mode {
	V4L2_CID_MPEG_VIDC_VIDEO_MBI_MODE_DEFAULT = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_MBI_MODE_1 = 1,
	V4L2_CID_MPEG_VIDC_VIDEO_MBI_MODE_2 = 2,
	V4L2_CID_MPEG_VIDC_VIDEO_MBI_MODE_3 = 3,
};

enum vl42_mpeg_vidc_video_h264_svc_nal {
	V4L2_CID_MPEG_VIDC_VIDEO_H264_NAL_SVC_DISABLED = 0,
	V4L2_CID_MPEG_VIDC_VIDEO_H264_NAL_SVC_ENABLED = 1,
};

enum v4l2_mpeg_vidc_video_h264_vui_timing_info {
	V4L2_MPEG_VIDC_VIDEO_H264_VUI_TIMING_INFO_DISABLED = 0,
	V4L2_MPEG_VIDC_VIDEO_H264_VUI_TIMING_INFO_ENABLED = 1
};

#define V4L2_QCOM_BUF_FLAG_EOSEQ                0x00040000
#define V4L2_QCOM_BUF_TIMESTAMP_INVALID         0x00080000
#define V4L2_MSM_BUF_FLAG_MBAFF                 0x00000200
#define V4L2_QCOM_BUF_FLAG_DECODEONLY           0x00200000
#define V4L2_QCOM_BUF_DROP_FRAME                0x00800000
#define V4L2_MSM_VIDC_BUF_START_CODE_NOT_FOUND  0x08000000
#define V4L2_MSM_BUF_FLAG_YUV_601_709_CLAMP     0x10000000
#define V4L2_MSM_BUF_FLAG_DEFER                 0x40000000
#define V4L2_QCOM_BUF_FLAG_IDRFRAME             0x80000000
#define V4L2_QCOM_BUF_END_OF_SUBFRAME   V4L2_BUF_FLAG_END_OF_SUBFRAME
#define V4L2_QCOM_BUF_FLAG_CODECCONFIG  V4L2_BUF_FLAG_CODECCONFIG
#define V4L2_QCOM_BUF_INPUT_UNSUPPORTED V4L2_BUF_INPUT_UNSUPPORTED
#define V4L2_QCOM_BUF_FLAG_EOS	V4L2_BUF_FLAG_EOS
#define V4L2_QCOM_BUF_FLAG_READONLY V4L2_BUF_FLAG_READONLY
#define V4L2_QCOM_BUF_FLAG_PERF_MODE	V4L2_BUF_FLAG_PERF_MODE

#define V4L2_DEC_QCOM_CMD_RECONFIG_HINT  (6)
#define V4L2_QCOM_CMD_FLUSH	V4L2_CMD_FLUSH
#define V4L2_QCOM_CMD_SESSION_CONTINUE	V4L2_CMD_SESSION_CONTINUE
#define V4L2_QCOM_CMD_FLUSH_OUTPUT	V4L2_CMD_FLUSH_OUTPUT
#define V4L2_QCOM_CMD_FLUSH_CAPTURE	V4L2_CMD_FLUSH_CAPTURE

#define V4L2_EVENT_BITDEPTH_FLAG	0x1
#define V4L2_EVENT_PICSTRUCT_FLAG	0x2
#define V4L2_EVENT_COLOUR_SPACE_FLAG	0x4

/*
 * Bitdepth changed insufficient is deprecated now, however retaining
 * to prevent changing the values of the other macros after bitdepth
 */
#define V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_BITDEPTH_CHANGED_INSUFFICIENT \
		(V4L2_EVENT_MSM_VIDC_START + 4)

struct msm_vidc_extradata_header {
	unsigned int size;
	unsigned int:32; /** Keeping binary compatibility */
	unsigned int:32; /* with firmware and OpenMAX IL **/
	unsigned int type; /* msm_vidc_extradata_type */
	unsigned int data_size;
	unsigned char data[1];
};

struct msm_vidc_interlace_payload {
	unsigned int format;
	unsigned int color_format;
};

struct msm_vidc_framerate_payload {
	unsigned int frame_rate;
};

struct msm_vidc_ts_payload {
	unsigned int timestamp_lo;
	unsigned int timestamp_hi;
};

struct msm_vidc_concealmb_payload {
	unsigned int num_mbs;
};

struct msm_vidc_recoverysei_payload {
	unsigned int flags;
};

struct msm_vidc_aspect_ratio_payload {
	unsigned int size;
	unsigned int version;
	unsigned int port_index;
	unsigned int aspect_width;
	unsigned int aspect_height;
};

struct msm_vidc_mpeg2_seqdisp_payload {
	unsigned int video_format;
	unsigned int color_descp;
	unsigned int color_primaries;
	unsigned int transfer_char;
	unsigned int matrix_coeffs;
	unsigned int disp_width;
	unsigned int disp_height;
};

struct msm_vidc_vc1_seqdisp_payload {
	unsigned int prog_seg_format;
	unsigned int uv_sampl_fmt;
	unsigned int color_format;
	unsigned int color_primaries;
	unsigned int transfer_char;
	unsigned int matrix_coeffs;
	unsigned int aspect_ratio;
	unsigned int aspect_horiz;
	unsigned int aspect_vert;
};

struct msm_vidc_input_crop_payload {
	unsigned int size;
	unsigned int version;
	unsigned int port_index;
	unsigned int left;
	unsigned int top;
	unsigned int width;
	unsigned int height;
};

struct msm_vidc_misr_info {
	unsigned int misr_dpb_luma;
	unsigned int misr_dpb_chroma;
	unsigned int misr_opb_luma;
	unsigned int misr_opb_chroma;
};
struct msm_vidc_output_crop_payload {
	unsigned int size;
	unsigned int version;
	unsigned int port_index;
	unsigned int left;
	unsigned int top;
	unsigned int display_width;
	unsigned int display_height;
	unsigned int width;
	unsigned int height;
	unsigned int frame_num;
	unsigned int bit_depth_y;
	unsigned int bit_depth_c;
	struct msm_vidc_misr_info misr_info[2];
};


struct msm_vidc_digital_zoom_payload {
	unsigned int size;
	unsigned int version;
	unsigned int port_index;
	unsigned int zoom_width;
	unsigned int zoom_height;
};

struct msm_vidc_extradata_index {
	unsigned int type;
	union {
		struct msm_vidc_input_crop_payload input_crop;
		struct msm_vidc_digital_zoom_payload digital_zoom;
		struct msm_vidc_aspect_ratio_payload aspect_ratio;
	};
};

struct msm_vidc_panscan_window {
	unsigned int panscan_height_offset;
	unsigned int panscan_width_offset;
	unsigned int panscan_window_width;
	unsigned int panscan_window_height;
};

struct msm_vidc_panscan_window_payload {
	unsigned int num_panscan_windows;
	struct msm_vidc_panscan_window wnd[1];
};

struct msm_vidc_stream_userdata_payload {
	unsigned int type;
	unsigned int data[1];
};

struct msm_vidc_frame_qp_payload {
	unsigned int frame_qp;
	unsigned int qp_sum;
	unsigned int skip_qp_sum;
	unsigned int skip_num_blocks;
	unsigned int total_num_blocks;
};

struct msm_vidc_frame_bits_info_payload {
	unsigned int frame_bits;
	unsigned int header_bits;
};

struct msm_vidc_s3d_frame_packing_payload {
	unsigned int fpa_id;
	unsigned int cancel_flag;
	unsigned int fpa_type;
	unsigned int quin_cunx_flag;
	unsigned int content_interprtation_type;
	unsigned int spatial_flipping_flag;
	unsigned int frame0_flipped_flag;
	unsigned int field_views_flag;
	unsigned int current_frame_is_frame0_flag;
	unsigned int frame0_self_contained_flag;
	unsigned int frame1_self_contained_flag;
	unsigned int frame0_graid_pos_x;
	unsigned int frame0_graid_pos_y;
	unsigned int frame1_graid_pos_x;
	unsigned int frame1_graid_pos_y;
	unsigned int fpa_reserved_byte;
	unsigned int fpa_repetition_period;
	unsigned int fpa_extension_flag;
};

struct msm_vidc_vqzip_sei_payload {
	unsigned int size;
	unsigned int data[1];
};

struct msm_vidc_ubwc_cr_stats_info {
	unsigned int stats_tile_32;
	unsigned int stats_tile_64;
	unsigned int stats_tile_96;
	unsigned int stats_tile_128;
	unsigned int stats_tile_160;
	unsigned int stats_tile_192;
	unsigned int stats_tile_256;
};

struct msm_vidc_yuv_stats_payload {
	unsigned int frame_qp;
	unsigned int texture;
	unsigned int luma_in_q16;
	unsigned int frame_difference;
};

struct msm_vidc_vpx_colorspace_payload {
	unsigned int color_space;
	unsigned int yuv_range_flag;
	unsigned int sumsampling_x;
	unsigned int sumsampling_y;
};

struct msm_vidc_roi_qp_payload {
	int upper_qp_offset;
	int lower_qp_offset;
	unsigned int b_roi_info;
	int mbi_info_size;
	unsigned int data[1];
};

struct msm_vidc_mastering_display_colour_sei_payload {
	unsigned int nDisplayPrimariesX[3];
	unsigned int nDisplayPrimariesY[3];
	unsigned int nWhitePointX;
	unsigned int nWhitePointY;
	unsigned int nMaxDisplayMasteringLuminance;
	unsigned int nMinDisplayMasteringLuminance;
};

struct msm_vidc_content_light_level_sei_payload {
	unsigned int nMaxContentLight;
	unsigned int nMaxPicAverageLight;
};

struct msm_vidc_vui_display_info_payload {
	unsigned int video_signal_present_flag;
	unsigned int video_format;
	unsigned int bit_depth_y;
	unsigned int bit_depth_c;
	unsigned int video_full_range_flag;
	unsigned int color_description_present_flag;
	unsigned int color_primaries;
	unsigned int transfer_characteristics;
	unsigned int matrix_coefficients;
	unsigned int chroma_location_info_present_flag;
	unsigned int chroma_format_idc;
	unsigned int separate_color_plane_flag;
	unsigned int chroma_sample_loc_type_top_field;
	unsigned int chroma_sample_loc_type_bottom_field;
};

enum msm_vidc_extradata_type {
	MSM_VIDC_EXTRADATA_NONE = 0x00000000,
	MSM_VIDC_EXTRADATA_MB_QUANTIZATION = 0x00000001,
	MSM_VIDC_EXTRADATA_INTERLACE_VIDEO = 0x00000002,
	MSM_VIDC_EXTRADATA_VC1_FRAMEDISP = 0x00000003,
	MSM_VIDC_EXTRADATA_VC1_SEQDISP = 0x00000004,
	MSM_VIDC_EXTRADATA_TIMESTAMP = 0x00000005,
	MSM_VIDC_EXTRADATA_S3D_FRAME_PACKING = 0x00000006,
	MSM_VIDC_EXTRADATA_FRAME_RATE = 0x00000007,
	MSM_VIDC_EXTRADATA_PANSCAN_WINDOW = 0x00000008,
	MSM_VIDC_EXTRADATA_RECOVERY_POINT_SEI = 0x00000009,
	MSM_VIDC_EXTRADATA_MPEG2_SEQDISP = 0x0000000D,
	MSM_VIDC_EXTRADATA_STREAM_USERDATA = 0x0000000E,
	MSM_VIDC_EXTRADATA_FRAME_QP = 0x0000000F,
	MSM_VIDC_EXTRADATA_FRAME_BITS_INFO = 0x00000010,
	MSM_VIDC_EXTRADATA_VQZIP_SEI = 0x00000011,
	MSM_VIDC_EXTRADATA_ROI_QP = 0x00000013,
#define MSM_VIDC_EXTRADATA_VPX_COLORSPACE_INFO \
	MSM_VIDC_EXTRADATA_VPX_COLORSPACE_INFO
	MSM_VIDC_EXTRADATA_VPX_COLORSPACE_INFO = 0x00000014,
#define MSM_VIDC_EXTRADATA_MASTERING_DISPLAY_COLOUR_SEI \
	MSM_VIDC_EXTRADATA_MASTERING_DISPLAY_COLOUR_SEI
	MSM_VIDC_EXTRADATA_MASTERING_DISPLAY_COLOUR_SEI = 0x00000015,
#define MSM_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI \
	MSM_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI
	MSM_VIDC_EXTRADATA_CONTENT_LIGHT_LEVEL_SEI = 0x00000016,
#define MSM_VIDC_EXTRADATA_PQ_INFO \
	MSM_VIDC_EXTRADATA_PQ_INFO
	MSM_VIDC_EXTRADATA_PQ_INFO = 0x00000017,
#define MSM_VIDC_EXTRADATA_COLOUR_REMAPPING_INFO_SEI \
	MSM_VIDC_EXTRADATA_COLOUR_REMAPPING_INFO_SEI
	MSM_VIDC_EXTRADATA_COLOUR_REMAPPING_INFO_SEI = 0x00000018,
#define MSM_VIDC_EXTRADATA_UBWC_CR_STAT_INFO \
	MSM_VIDC_EXTRADATA_UBWC_CR_STAT_INFO
	MSM_VIDC_EXTRADATA_UBWC_CR_STAT_INFO = 0x00000019,
	MSM_VIDC_EXTRADATA_INPUT_CROP = 0x0700000E,
#define MSM_VIDC_EXTRADATA_OUTPUT_CROP \
	MSM_VIDC_EXTRADATA_OUTPUT_CROP
	MSM_VIDC_EXTRADATA_OUTPUT_CROP = 0x0700000F,
	MSM_VIDC_EXTRADATA_DIGITAL_ZOOM = 0x07000010,
	MSM_VIDC_EXTRADATA_MULTISLICE_INFO = 0x7F100000,
	MSM_VIDC_EXTRADATA_NUM_CONCEALED_MB = 0x7F100001,
	MSM_VIDC_EXTRADATA_INDEX = 0x7F100002,
	MSM_VIDC_EXTRADATA_ASPECT_RATIO = 0x7F100003,
	MSM_VIDC_EXTRADATA_METADATA_LTR = 0x7F100004,
	MSM_VIDC_EXTRADATA_METADATA_FILLER = 0x7FE00002,
	MSM_VIDC_EXTRADATA_METADATA_MBI = 0x7F100005,
#define MSM_VIDC_EXTRADATA_VUI_DISPLAY_INFO \
	MSM_VIDC_EXTRADATA_VUI_DISPLAY_INFO
	MSM_VIDC_EXTRADATA_VUI_DISPLAY_INFO = 0x7F100006,
	MSM_VIDC_EXTRADATA_YUVSTATS_INFO = 0x7F100007,
};
enum msm_vidc_interlace_type {
	MSM_VIDC_INTERLACE_FRAME_PROGRESSIVE = 0x01,
	MSM_VIDC_INTERLACE_INTERLEAVE_FRAME_TOPFIELDFIRST = 0x02,
	MSM_VIDC_INTERLACE_INTERLEAVE_FRAME_BOTTOMFIELDFIRST = 0x04,
	MSM_VIDC_INTERLACE_FRAME_TOPFIELDFIRST = 0x08,
	MSM_VIDC_INTERLACE_FRAME_BOTTOMFIELDFIRST = 0x10,
#define MSM_VIDC_INTERLACE_FRAME_MBAFF \
	MSM_VIDC_INTERLACE_FRAME_MBAFF
	MSM_VIDC_INTERLACE_FRAME_MBAFF = 0x20,
};

/* enum msm_vidc_framepack_type */
#define MSM_VIDC_FRAMEPACK_CHECKERBOARD 0x00
#define MSM_VIDC_FRAMEPACK_COLUMN_INTERLEAVE 0x01
#define MSM_VIDC_FRAMEPACK_ROW_INTERLEAVE 0x02
#define MSM_VIDC_FRAMEPACK_SIDE_BY_SIDE 0x03
#define MSM_VIDC_FRAMEPACK_TOP_BOTTOM 0x04
#define MSM_VIDC_FRAMEPACK_TEMPORAL_INTERLEAVE 0x05

enum msm_vidc_recovery_sei {
	MSM_VIDC_FRAME_RECONSTRUCTION_INCORRECT = 0x0,
	MSM_VIDC_FRAME_RECONSTRUCTION_CORRECT = 0x01,
	MSM_VIDC_FRAME_RECONSTRUCTION_APPROXIMATELY_CORRECT = 0x02,
};
enum msm_vidc_userdata_type {
	MSM_VIDC_USERDATA_TYPE_FRAME = 0x1,
	MSM_VIDC_USERDATA_TYPE_TOP_FIELD = 0x2,
	MSM_VIDC_USERDATA_TYPE_BOTTOM_FIELD = 0x3,
};

/* See colour_primaries of ISO/IEC 14496 for significance */
enum msm_vidc_h264_color_primaries_values {
	MSM_VIDC_RESERVED_1 = 0,
	MSM_VIDC_BT709_5 = 1,
	MSM_VIDC_UNSPECIFIED = 2,
	MSM_VIDC_RESERVED_2 = 3,
	MSM_VIDC_BT470_6_M = 4,
	MSM_VIDC_BT601_6_625 = 5,
	MSM_VIDC_BT470_6_BG = MSM_VIDC_BT601_6_625,
	MSM_VIDC_BT601_6_525 = 6,
	MSM_VIDC_SMPTE_240M = 7,
	MSM_VIDC_GENERIC_FILM = 8,
	MSM_VIDC_BT2020 = 9,
};

enum msm_vidc_vp9_color_primaries_values {
	MSM_VIDC_CS_UNKNOWN,
	MSM_VIDC_CS_BT_601,
	MSM_VIDC_CS_BT_709,
	MSM_VIDC_CS_SMPTE_170,
	MSM_VIDC_CS_SMPTE_240,
	MSM_VIDC_CS_BT_2020,
	MSM_VIDC_CS_RESERVED,
	MSM_VIDC_CS_RGB,
};

enum msm_vidc_h264_matrix_coeff_values {
	MSM_VIDC_MATRIX_RGB = 0,
	MSM_VIDC_MATRIX_BT_709_5 = 1,
	MSM_VIDC_MATRIX_UNSPECIFIED = 2,
	MSM_VIDC_MATRIX_RESERVED = 3,
	MSM_VIDC_MATRIX_FCC_47 = 4,
	MSM_VIDC_MATRIX_601_6_625 = 5,
	MSM_VIDC_MATRIX_BT470_BG = MSM_VIDC_MATRIX_601_6_625,
	MSM_VIDC_MATRIX_601_6_525 = 6,
	MSM_VIDC_MATRIX_SMPTE_170M = MSM_VIDC_MATRIX_601_6_525,
	MSM_VIDC_MATRIX_SMPTE_240M = 7,
	MSM_VIDC_MATRIX_Y_CG_CO = 8,
	MSM_VIDC_MATRIX_BT_2020 = 9,
	MSM_VIDC_MATRIX_BT_2020_CONST = 10,
};

enum msm_vidc_h264_transfer_chars_values {
	MSM_VIDC_TRANSFER_RESERVED_1 = 0,
	MSM_VIDC_TRANSFER_BT709_5 = 1,
	MSM_VIDC_TRANSFER_UNSPECIFIED = 2,
	MSM_VIDC_TRANSFER_RESERVED_2 = 3,
	MSM_VIDC_TRANSFER_BT_470_6_M = 4,
	MSM_VIDC_TRANSFER_BT_470_6_BG = 5,
	MSM_VIDC_TRANSFER_601_6_625 = 6,
	MSM_VIDC_TRANSFER_601_6_525 = MSM_VIDC_TRANSFER_601_6_625,
	MSM_VIDC_TRANSFER_SMPTE_240M = 7,
	MSM_VIDC_TRANSFER_LINEAR = 8,
	MSM_VIDC_TRANSFER_LOG_100_1 = 9,
	MSM_VIDC_TRANSFER_LOG_100_SQRT10_1 = 10,
	MSM_VIDC_TRANSFER_IEC_61966 = 11,
	MSM_VIDC_TRANSFER_BT_1361 = 12,
	MSM_VIDC_TRANSFER_SRGB = 13,
	MSM_VIDC_TRANSFER_BT_2020_10 = 14,
	MSM_VIDC_TRANSFER_BT_2020_12 = 15,
#define MSM_VIDC_TRANSFER_SMPTE_ST2084 \
	MSM_VIDC_TRANSFER_SMPTE_ST2084
	MSM_VIDC_TRANSFER_SMPTE_ST2084 = 16,
#define MSM_VIDC_TRANSFER_SMPTE_ST428_1 \
	MSM_VIDC_TRANSFER_SMPTE_ST428_1
	MSM_VIDC_TRANSFER_SMPTE_ST428_1 = 17,
#define MSM_VIDC_TRANSFER_HLG \
	MSM_VIDC_TRANSFER_HLG
	MSM_VIDC_TRANSFER_HLG = 18,
};

enum msm_vidc_pixel_depth {
	MSM_VIDC_BIT_DEPTH_8,
	MSM_VIDC_BIT_DEPTH_10,
	MSM_VIDC_BIT_DEPTH_UNSUPPORTED = 0XFFFFFFFF,
};

enum msm_vidc_video_format {
	MSM_VIDC_COMPONENT,
	MSM_VIDC_PAL,
	MSM_VIDC_NTSC,
	MSM_VIDC_SECAM,
	MSM_VIDC_MAC,
	MSM_VIDC_UNSPECIFIED_FORMAT,
	MSM_VIDC_RESERVED_1_FORMAT,
	MSM_VIDC_RESERVED_2_FORMAT,
};

enum msm_vidc_color_desc_flag {
	MSM_VIDC_COLOR_DESC_NOT_PRESENT,
	MSM_VIDC_COLOR_DESC_PRESENT,
};

/*enum msm_vidc_pic_struct */
#define MSM_VIDC_PIC_STRUCT_MAYBE_INTERLACED 0x0
#define MSM_VIDC_PIC_STRUCT_PROGRESSIVE 0x1
#define MSM_VIDC_PIC_STRUCT_UNKNOWN 0XFFFFFFFF
/*default when layer ID isn't specified*/
#define MSM_VIDC_ALL_LAYER_ID 0xFF

#endif
